Skip to content

feat(davinci-client): support single checkbox component#629

Open
ancheetah wants to merge 1 commit into
mainfrom
SDKS-4926-single-checkbox
Open

feat(davinci-client): support single checkbox component#629
ancheetah wants to merge 1 commit into
mainfrom
SDKS-4926-single-checkbox

Conversation

@ancheetah
Copy link
Copy Markdown
Collaborator

@ancheetah ancheetah commented May 11, 2026

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-4926

Description

Adds support for single checkbox component through a ValidatedBooleanCollector

Summary by CodeRabbit

  • New Features
    • Added single-checkbox fields to forms: users can now submit boolean selections via a rendered checkbox UI with required validation and configurable error messages.
    • Form clients now accept and propagate boolean values for checkbox inputs, enabling end-to-end handling of checkbox responses.

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

⚠️ No Changeset found

Latest commit: af9e242

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

Adds SingleCheckboxField and ValidatedBooleanCollector across types, collector factory, Redux reducer, client update typing, API reports, and an e2e checkbox component; also updates tsconfig references and .gitignore.

Changes

ValidatedBooleanCollector Feature

Layer / File(s) Summary
Type System Foundation
packages/davinci-client/src/lib/davinci.types.ts, packages/davinci-client/src/lib/collector.types.ts
Add SingleCheckboxField and ValidatedBooleanCollector; make single-value collector interfaces generic over V; extend unions and inference to include boolean collectors.
Collector Factory & Validation
packages/davinci-client/src/lib/collector.utils.ts
Extend returnSingleValueCollector to handle ValidatedBooleanCollector, add returnValidatedBooleanCollector, and include ValidatedBooleanCollector in returnValidator for validation rules.
Client Type Mapping
packages/davinci-client/src/lib/client.types.ts, packages/davinci-client/src/lib/client.store.ts
CollectorValueType<T> maps ValidatedBooleanCollectorboolean; client update method now accepts boolean in the value union.
Redux Reducer State Updates
packages/davinci-client/src/lib/node.reducer.ts
node/next initializes SINGLE_CHECKBOX via returnValidatedBooleanCollector; updateCollectorValues payload and node/update logic accept and handle boolean values for ValidatedBooleanCollector.
Public Exports & Tests
packages/davinci-client/src/lib/node.types.ts, packages/davinci-client/src/lib/node.types.test-d.ts, packages/davinci-client/src/lib/collector.types.test-d.ts
Export ValidatedBooleanCollector in Collectors union and update type-level tests/imports to reflect the new collector and generic refactor.
E2E Component & Wiring
e2e/davinci-app/components/boolean.ts, e2e/davinci-app/main.ts
Add booleanComponent rendering a single checkbox from collector.output and integrate it into the main app render loop wired to davinciClient.update(collector).
API Reports
packages/davinci-client/api-report/*, packages/davinci-client/api-report/davinci-client.types.api.md
API-report updates reflect the new field/collector types, generic single-value refactor, payload widening, PhoneNumberExtension types, and pollpollStatus rename.
Formatting, Config, .gitignore
.gitignore, packages/davinci-client/tsconfig.json, assorted types
Add .claude/skills to .gitignore; trim tsconfig project references; reformat FIDO-related type expressions (no semantics changed).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • cerebrl
  • vatsalparikh
  • ryanbas21

🐰 A checkbox hops into view,
I nibble truth from false and true,
Validation stitched with gentle art,
Collectors learn the boolean part,
Hooray — a tiny checkbox crew!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes the required JIRA ticket link and explains the change, but does not mention whether a changeset was added despite the template prompt asking about it. Clarify whether a changeset entry was created for this feature, as required by the repository's versioning/release process.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding support for a single checkbox component to the davinci-client package.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-4926-single-checkbox

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 11, 2026

View your CI Pipeline Execution ↗ for commit af9e242


☁️ Nx Cloud last updated this comment at 2026-05-11 20:27:17 UTC

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
e2e/davinci-app/components/boolean.ts (2)

1-6: 💤 Low value

Nitpick: Copyright year inconsistency.

This file uses copyright year 2026, while other files in the codebase use 2025. Consider using 2025 for consistency, unless this is intentional.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/components/boolean.ts` around lines 1 - 6, Update the
copyright header year from 2026 to 2025 in the top-of-file comment block in
e2e/davinci-app/components/boolean.ts so it matches the rest of the repository;
edit the existing comment lines (the block that starts with "Copyright (c) 2026
Ping Identity Corporation") to use 2025 instead.

24-28: 💤 Low value

Optional: Duplicate label might cause confusion.

The component creates a group label (lines 26-28) and an individual checkbox label (lines 41-43), both displaying the same text from collector.output.label. For a single checkbox component, this creates visual duplication. Consider removing the group label or differentiating the text.

♻️ Possible refinement
-  // Create a heading/label for the checkbox group
-  const groupLabel = document.createElement('div');
-  groupLabel.textContent = collector.output.label || 'Single Checkbox';
-  groupLabel.className = 'single-checkbox-label';
-  containerDiv.appendChild(groupLabel);
-
   // Create checkboxes for each option
   const wrapper = document.createElement('div');
   wrapper.className = 'checkbox-wrapper';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/components/boolean.ts` around lines 24 - 28, The component
currently creates a duplicate visible label by appending a groupLabel (const
groupLabel) with text from collector.output.label and also rendering an
individual checkbox label later, causing visual duplication in the
single-checkbox UI; fix by removing or hiding the redundant group label when
rendering a single checkbox — either stop creating/appending groupLabel (remove
the containerDiv.appendChild(groupLabel) lines) or change groupLabel.textContent
to a different contextual string (or add a CSS class to visually hide it) and
ensure the individual checkbox label (the per-checkbox label element) remains
the primary visible label.
packages/davinci-client/src/lib/collector.types.ts (1)

634-635: 💤 Low value

Formatting change unrelated to PR objective.

The reformatting of AttestationValue and AssertionValue from multiline to single-line Omit expressions appears unrelated to the checkbox support feature. While this doesn't change functionality, consider whether this formatting change belongs in a separate PR focused on code style.

Also applies to: 653-654

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.types.ts` around lines 634 - 635,
The PR contains unrelated formatting changes: the multiline Omit types for
AttestationValue and AssertionValue were collapsed into single-line forms;
revert these formatting-only edits so they remain multiline (as before) and move
any styling-only changes to a separate PR. Locate the AttestationValue and
AssertionValue type declarations in collector.types.ts and restore their
original multiline formatting (preserving the exact type members:
Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' |
'toJSON'> and Omit<PublicKeyCredential, 'rawId' | 'response' |
'getClientExtensionResults' | 'toJSON'> respectively), ensuring no functional
changes are introduced.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/davinci-app/components/boolean.ts`:
- Around line 34-39: The SingleCheckboxField's required flag isn't applied to
the created checkbox element; update the element creation in the component that
builds the checkbox (where checkbox is created from collector.output) to set
checkbox.required = !!collector.output.required (and optionally
checkbox.setAttribute('aria-required','true') for accessibility) so the HTML
required validation is honored; ensure you reference collector.output.required
and the checkbox element in the SingleCheckboxField handling logic.
- Around line 46-49: The change handler for the checkbox uses the static value
attribute and compares target.value === 'checked', which is always true; update
the event listener on checkbox (the callback passed to
checkbox.addEventListener('change', ...)) to call updater with the actual
boolean state using target.checked instead of comparing target.value, i.e.,
replace the expression target.value === 'checked' with target.checked so the
updater receives the real checked state.

In `@packages/davinci-client/src/lib/collector.utils.ts`:
- Line 250: The new AND check causes required-only text fields to skip
validation; revert the outer conditional in the text-field branch to use OR
(i.e. change "else if ('validation' in field && field.validation && 'regex' in
field.validation)" back to "else if ('validation' in field || 'required' in
field)") so that fields with either validation or required:true are handled by
the ValidatedTextCollector/validation logic (the inner branches already
distinguish regex vs required), preventing them from falling through to
SingleValueCollector.

In `@packages/davinci-client/src/lib/node.reducer.ts`:
- Around line 196-198: The SINGLE_CHECKBOX branch in node.reducer.ts currently
calls returnValidatedBooleanCollector(field, idx) without passing the prefill
value; update the case for 'SINGLE_CHECKBOX' to extract the data variable from
formData (same way other branches do) and call
returnValidatedBooleanCollector(field, idx, data). Then update
returnValidatedBooleanCollector to accept the extra data parameter and forward
it into returnSingleValueCollector so SINGLE_CHECKBOX supports prefilled values,
mirroring how returnTextCollector and returnSingleSelectCollector handle the
data.

---

Nitpick comments:
In `@e2e/davinci-app/components/boolean.ts`:
- Around line 1-6: Update the copyright header year from 2026 to 2025 in the
top-of-file comment block in e2e/davinci-app/components/boolean.ts so it matches
the rest of the repository; edit the existing comment lines (the block that
starts with "Copyright (c) 2026 Ping Identity Corporation") to use 2025 instead.
- Around line 24-28: The component currently creates a duplicate visible label
by appending a groupLabel (const groupLabel) with text from
collector.output.label and also rendering an individual checkbox label later,
causing visual duplication in the single-checkbox UI; fix by removing or hiding
the redundant group label when rendering a single checkbox — either stop
creating/appending groupLabel (remove the containerDiv.appendChild(groupLabel)
lines) or change groupLabel.textContent to a different contextual string (or add
a CSS class to visually hide it) and ensure the individual checkbox label (the
per-checkbox label element) remains the primary visible label.

In `@packages/davinci-client/src/lib/collector.types.ts`:
- Around line 634-635: The PR contains unrelated formatting changes: the
multiline Omit types for AttestationValue and AssertionValue were collapsed into
single-line forms; revert these formatting-only edits so they remain multiline
(as before) and move any styling-only changes to a separate PR. Locate the
AttestationValue and AssertionValue type declarations in collector.types.ts and
restore their original multiline formatting (preserving the exact type members:
Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' |
'toJSON'> and Omit<PublicKeyCredential, 'rawId' | 'response' |
'getClientExtensionResults' | 'toJSON'> respectively), ensuring no functional
changes are introduced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 524a05e9-77c1-451f-9f1a-fa7ce5b9287b

📥 Commits

Reviewing files that changed from the base of the PR and between 44f9be3 and f4d8163.

📒 Files selected for processing (12)
  • .gitignore
  • e2e/davinci-app/components/boolean.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/tsconfig.json
💤 Files with no reviewable changes (1)
  • packages/davinci-client/tsconfig.json

Comment on lines +34 to +39
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = collector.output.key;
checkbox.name = collector.output.key || 'single-checkbox-field';
checkbox.checked = collector.output.value as boolean;
checkbox.value = 'checked';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Minor: Consider adding required attribute support.

The SingleCheckboxField type includes a required property, but the component doesn't set the HTML required attribute on the checkbox element. This means required validation won't work as expected.

🛡️ Proposed fix
   const checkbox = document.createElement('input');
   checkbox.type = 'checkbox';
   checkbox.id = collector.output.key;
   checkbox.name = collector.output.key || 'single-checkbox-field';
   checkbox.checked = collector.output.value as boolean;
   checkbox.value = 'checked';
+  if (collector.output.required) {
+    checkbox.required = true;
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = collector.output.key;
checkbox.name = collector.output.key || 'single-checkbox-field';
checkbox.checked = collector.output.value as boolean;
checkbox.value = 'checked';
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = collector.output.key;
checkbox.name = collector.output.key || 'single-checkbox-field';
checkbox.checked = collector.output.value as boolean;
checkbox.value = 'checked';
if (collector.output.required) {
checkbox.required = true;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/components/boolean.ts` around lines 34 - 39, The
SingleCheckboxField's required flag isn't applied to the created checkbox
element; update the element creation in the component that builds the checkbox
(where checkbox is created from collector.output) to set checkbox.required =
!!collector.output.required (and optionally
checkbox.setAttribute('aria-required','true') for accessibility) so the HTML
required validation is honored; ensure you reference collector.output.required
and the checkbox element in the SingleCheckboxField handling logic.

Comment on lines +46 to +49
checkbox.addEventListener('change', (event) => {
const target = event.target as HTMLInputElement;
updater(target.value === 'checked');
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify checkbox event handling in similar components

# Search for other checkbox change event handlers in the codebase
rg -n -A3 -B3 "addEventListener\s*\(\s*['\"]change['\"]" --glob "*.ts" --glob "*.js" -g '!node_modules'

Repository: ForgeRock/ping-javascript-sdk

Length of output: 7149


🏁 Script executed:

cat -n e2e/davinci-app/components/boolean.ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 2558


Use target.checked instead of target.value === 'checked'.

The checkbox value attribute (line 39) is a static string that never changes based on checkbox state. The expression target.value === 'checked' will always evaluate to true, regardless of whether the checkbox is checked or unchecked. This breaks the boolean field functionality. Use target.checked to get the actual checkbox state, which is also the pattern used in other checkbox handlers throughout the codebase (e.g., terms-and-conditions.ts, confirmation.ts).

Proposed fix
   checkbox.addEventListener('change', (event) => {
     const target = event.target as HTMLInputElement;
-    updater(target.value === 'checked');
+    updater(target.checked);
   });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
checkbox.addEventListener('change', (event) => {
const target = event.target as HTMLInputElement;
updater(target.value === 'checked');
});
checkbox.addEventListener('change', (event) => {
const target = event.target as HTMLInputElement;
updater(target.checked);
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/components/boolean.ts` around lines 46 - 49, The change
handler for the checkbox uses the static value attribute and compares
target.value === 'checked', which is always true; update the event listener on
checkbox (the callback passed to checkbox.addEventListener('change', ...)) to
call updater with the actual boolean state using target.checked instead of
comparing target.value, i.e., replace the expression target.value === 'checked'
with target.checked so the updater receives the real checked state.

Comment thread packages/davinci-client/src/lib/collector.utils.ts
Comment on lines +196 to +198
case 'SINGLE_CHECKBOX': {
return returnValidatedBooleanCollector(field, idx);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check the signature and implementation of returnValidatedBooleanCollector

# Find the implementation of returnValidatedBooleanCollector
ast-grep --pattern $'export function returnValidatedBooleanCollector($$$) {
  $$$
}'

# Also search for its usage to understand the expected parameters
rg -n -A10 "returnValidatedBooleanCollector" --type ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 4218


🏁 Script executed:

#!/bin/bash

# Check returnSingleValueCollector implementation
rg -n -B5 -A15 "export function returnSingleValueCollector" packages/davinci-client/src/lib/collector.utils.ts

# Check returnTextCollector signature and implementation
rg -n -B5 -A15 "export function returnTextCollector" packages/davinci-client/src/lib/collector.utils.ts

# Get more context around the SINGLE_CHECKBOX case in node.reducer.ts
# to understand where data comes from
rg -n -B20 "case 'SINGLE_CHECKBOX'" packages/davinci-client/src/lib/node.reducer.ts | head -50

Repository: ForgeRock/ping-javascript-sdk

Length of output: 3362


🏁 Script executed:

#!/bin/bash

# Get the full implementation of returnSingleValueCollector
sed -n '155,200p' packages/davinci-client/src/lib/collector.utils.ts

# Also check what happens after line 200 to see how data is used
sed -n '155,250p' packages/davinci-client/src/lib/collector.utils.ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 4790


🏁 Script executed:

#!/bin/bash

# Get more context around SINGLE_CHECKBOX to understand the data variable
# and see how similar field types handle boolean-like data
sed -n '150,210p' packages/davinci-client/src/lib/node.reducer.ts

# Also check RADIO and DROPDOWN cases mentioned in the review
rg -n -B2 -A5 "case 'RADIO':|case 'DROPDOWN':" packages/davinci-client/src/lib/node.reducer.ts | head -40

Repository: ForgeRock/ping-javascript-sdk

Length of output: 2838


🏁 Script executed:

#!/bin/bash

# Check how the data value flows through for ValidatedBooleanCollector
# See if there's any conversion from boolean to string
sed -n '210,250p' packages/davinci-client/src/lib/collector.utils.ts

# Also check if there are TypeScript type definitions for ValidatedBooleanCollector
rg -n "ValidatedBooleanCollector" packages/davinci-client/src --type ts | head -20

Repository: ForgeRock/ping-javascript-sdk

Length of output: 3503


Add prefill support for SINGLE_CHECKBOX field type.

The SINGLE_CHECKBOX case doesn't extract or pass the data variable to returnValidatedBooleanCollector, unlike all other field types (e.g., TEXT, RADIO, DROPDOWN). This prevents checkboxes from supporting prefilled values from formData. Both the call site in node.reducer.ts and the returnValidatedBooleanCollector function need to be updated to pass the data through to returnSingleValueCollector, similar to how returnTextCollector and returnSingleSelectCollector handle it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/node.reducer.ts` around lines 196 - 198, The
SINGLE_CHECKBOX branch in node.reducer.ts currently calls
returnValidatedBooleanCollector(field, idx) without passing the prefill value;
update the case for 'SINGLE_CHECKBOX' to extract the data variable from formData
(same way other branches do) and call returnValidatedBooleanCollector(field,
idx, data). Then update returnValidatedBooleanCollector to accept the extra data
parameter and forward it into returnSingleValueCollector so SINGLE_CHECKBOX
supports prefilled values, mirroring how returnTextCollector and
returnSingleSelectCollector handle the data.

@ancheetah ancheetah force-pushed the SDKS-4926-single-checkbox branch from f4d8163 to af9e242 Compare May 11, 2026 20:26
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
e2e/davinci-app/main.ts (1)

298-300: ⚡ Quick win

Consider adding validation support for ValidatedBooleanCollector.

The ValidatedBooleanCollector handler passes only davinciClient.update(collector) to booleanComponent, but the collector type includes validation rules and the name indicates validation support. Compare with TextCollector handling (lines 234-240), which passes both update() and validate().

If the boolean component needs to enforce "required" validation (e.g., mandatory checkbox acceptance), consider passing davinciClient.validate(collector) as a third argument.

♻️ Potential enhancement
      } else if (collector.type === 'ValidatedBooleanCollector') {
-        booleanComponent(formEl, collector, davinciClient.update(collector));
+        booleanComponent(
+          formEl,
+          collector,
+          davinciClient.update(collector),
+          davinciClient.validate(collector),
+        );
      }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/main.ts` around lines 298 - 300, The
ValidatedBooleanCollector branch currently calls booleanComponent(formEl,
collector, davinciClient.update(collector)) but omits validation; modify the
ValidatedBooleanCollector handling so booleanComponent receives the validate
handler as well (e.g., pass davinciClient.validate(collector) in addition to
davinciClient.update(collector)), mirroring how TextCollector supplies both
update() and validate(); update the call site at the ValidatedBooleanCollector
branch to include davinciClient.validate(collector) so required/other validation
rules on the collector are enforced.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@e2e/davinci-app/main.ts`:
- Around line 298-300: The ValidatedBooleanCollector branch currently calls
booleanComponent(formEl, collector, davinciClient.update(collector)) but omits
validation; modify the ValidatedBooleanCollector handling so booleanComponent
receives the validate handler as well (e.g., pass
davinciClient.validate(collector) in addition to
davinciClient.update(collector)), mirroring how TextCollector supplies both
update() and validate(); update the call site at the ValidatedBooleanCollector
branch to include davinciClient.validate(collector) so required/other validation
rules on the collector are enforced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ff5f004-90c6-4033-83d2-2d5eaa35204e

📥 Commits

Reviewing files that changed from the base of the PR and between f4d8163 and af9e242.

📒 Files selected for processing (15)
  • .gitignore
  • e2e/davinci-app/components/boolean.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/tsconfig.json
💤 Files with no reviewable changes (1)
  • packages/davinci-client/tsconfig.json
✅ Files skipped from review due to trivial changes (4)
  • .gitignore
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/api-report/davinci-client.api.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/davinci-client/src/lib/client.types.ts
  • e2e/davinci-app/components/boolean.ts
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/collector.utils.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant